home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / LaserWriter--custom dialogs / The Approach-- dialogs < prev   
Encoding:
Text File  |  1996-03-20  |  2.8 KB  |  62 lines  |  [TEXT/MPS ]

  1. A brief description of the "LaserWriter--custom dialogs" code.
  2.  
  3. Messages overridden:
  4.  
  5. Overrides for our custom dialog support
  6. ---------------------------------------
  7. gxInitialize                 - Saves off app's A5.
  8. gxShutDown                    - Tosses our context data.
  9. gxPrDlgMain                    - Complete override for Job dialog, partial for Style.
  10. gxPrStlInit                    - Stores a flag which says "we're putting up the Style dialog."
  11. gxPrJobInit                    - Stores a flag which says "we're putting up the Job dialog."
  12.  
  13. Other driver overrides.
  14. -----------------------
  15. gxPrValidate                - Validates old print records.
  16. gxPrintDefault                - Creates a default print record.
  17. gxConvertPrintRecordTo        - Converts an old print record to a universal print record.
  18. gxConvertPrintRecordFrom    - Converts a universal print record to an old print record.
  19.  
  20.  
  21. What this code does:
  22. --------------------
  23. This PS driver has a completely custom job dialog, yet uses the default
  24. Page Setup dialog.
  25.  
  26.  
  27. Interesting tricks and tidbits:
  28. -------------------------------
  29. If you need to customize the old-API dialogs for a PostScript
  30. driver, you cannot simply add a 'dctl' and 'DITL' resource like you
  31. can for a raster or vector driver.  The default PostScript
  32. implementation will ignore your resources.  Also, because of
  33. everything the default PostScript implementation does with its own
  34. dctl behind the scenes, you cannot partially override gxPrDlgMain,
  35. switch in your dialog somehow and live to tell about it.  You must
  36. completely override gxPrDlgMain if you're doing custom old-API
  37. dialogs for a PostScript driver.
  38.  
  39. Our gxPrDlgMain code needs to determine if the Style or Job dialogs
  40. are being displayed.  It does this having its PrStlInit and PrJobInit
  41. overrides store a flag in the message instance's context.  This flag
  42. tells our PrDlgMain override if we're displaying the Style or Job
  43. dialogs.  If it's the Job dialog, we completely override PrDlgMain and
  44. handle the dialog.  If its the Style dialog, we simply forward the
  45. gxPrDlgMain message and let GX completely implement it.
  46.  
  47. You need the application's A5 reference if it adds things to the old
  48. dialogs via callbacks.  To get the application's A5, we save the
  49. currentA5 in the gxInitialize override.  That will be the app's A5
  50. reference.  We store this reference in our instance context for later
  51. retrieval.
  52.  
  53. The default PostScript implementation of PrJobInit installs an item
  54. handler proc for the default old-API dialogs.  The "print to file"
  55. StandardFile dialog is handled in that item handling proc.  Since
  56. we need to completely override gxPrJobInit, the default "print to file"
  57. file dialog code is never used.  You must supply that fuinctionality
  58. if you completely override PrJobInit, and you want to print to
  59. PostScript (or other) files.  This code has a routine called
  60. "PrepForFileWriting" which handles this work.
  61.  
  62. dmh 6/20/94